using System.Linq;
using SapaFinance.Domain.Model;
using SapaFinance.GenericRepository;

namespace SapaFinance.Domain.Specifications
{
    public interface IAgentSpecification : ISpecification<Agent>
    {
        IAgentSpecification Our();

    }

    public class AgentQueryableSpecification
       : QueryableSpecification<Agent>
         , IAgentSpecification
    {

        public AgentQueryableSpecification(IUnitOfWorkConvertor unitOfWorkConvertor)
            : base(unitOfWorkConvertor)
        {
        }

        public IAgentSpecification Our()
        {
            this.Queryable = this.Queryable.Where(c => c.IsSelfAgent);
            return this;
        }

    }
}